import java.util.Scanner;

public class Main1698 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = 1; i<=n; i++) {
            int j=i%10;
            if (i==1||i==3||i==5||i==7||j==1||j==3||j==5||j==7){
                System.out.println(i);
            }

        }
    }

}

